﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace An_Im.Theme.Custom
{
    public class AnToggleButton : ToggleButton
    {

        public double ImageSize
        {
            get { return (double)GetValue(ImageSizeProperty); }
            set { SetValue(ImageSizeProperty, value); }
        }

        // Using a DependencyProperty as the backing store for ImageSize.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ImageSizeProperty =
            DependencyProperty.Register("ImageSize", typeof(double), typeof(AnToggleButton), new PropertyMetadata(12d));



        public ImageSource AnToggleButton_IconSource
        {
            get { return (ImageSource)GetValue(AnToggleButton_IconSourceProperty); }
            set { SetValue(AnToggleButton_IconSourceProperty, value); }
        }

        // Using a DependencyProperty as the backing store for AnToggleButton_IconSource.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AnToggleButton_IconSourceProperty =
            DependencyProperty.Register("AnToggleButton_IconSource", typeof(ImageSource), typeof(AnToggleButton), new PropertyMetadata(null));



        public Brush AnToggleButton_NormalBackground
        {
            get { return (Brush)GetValue(AnToggleButton_NormalBackgroundProperty); }
            set { SetValue(AnToggleButton_NormalBackgroundProperty, value); }
        }

        // Using a DependencyProperty as the backing store for NormalBackground.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AnToggleButton_NormalBackgroundProperty =
            DependencyProperty.Register("AnToggleButton_NormalBackground", typeof(Brush), typeof(AnToggleButton), new PropertyMetadata(new SolidColorBrush(Colors.White)));



        public Brush AnToggleButton_OverBackground
        {
            get { return (Brush)GetValue(AnToggleButton_OverBackgroundProperty); }
            set { SetValue(AnToggleButton_OverBackgroundProperty, value); }
        }

        // Using a DependencyProperty as the backing store for OverBackground.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AnToggleButton_OverBackgroundProperty =
            DependencyProperty.Register("AnToggleButton_OverBackground", typeof(Brush), typeof(AnToggleButton), new PropertyMetadata(new SolidColorBrush(Colors.LightGray)));




        public Brush AnToggleButton_PressedBackground
        {
            get { return (Brush)GetValue(AnToggleButton_PressedBackgroundProperty); }
            set { SetValue(AnToggleButton_PressedBackgroundProperty, value); }
        }

        // Using a DependencyProperty as the backing store for PressedBackground.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AnToggleButton_PressedBackgroundProperty =
            DependencyProperty.Register("AnToggleButton_PressedBackground", typeof(Brush), typeof(AnToggleButton), new PropertyMetadata(new SolidColorBrush(Colors.Gray)));

        public Brush AnToggleButton_CheckedBackground
        {
            get { return (Brush)GetValue(AnToggleButton_CheckedBackgroundProperty); }
            set { SetValue(AnToggleButton_CheckedBackgroundProperty, value); }
        }

        // Using a DependencyProperty as the backing store for PressedBackground.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AnToggleButton_CheckedBackgroundProperty =
            DependencyProperty.Register("AnToggleButton_CheckedBackground", typeof(Brush), typeof(AnToggleButton), new PropertyMetadata(new SolidColorBrush(Colors.LightYellow)));



        public CornerRadius AnToggleButton_CornerRadius
        {
            get { return (CornerRadius)GetValue(AnToggleButton_CornerRadiusProperty); }
            set { SetValue(AnToggleButton_CornerRadiusProperty, value); }
        }

        // Using a DependencyProperty as the backing store for CornerRadius.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AnToggleButton_CornerRadiusProperty =
            DependencyProperty.Register("AnToggleButton_CornerRadius", typeof(CornerRadius), typeof(AnToggleButton), new PropertyMetadata(new CornerRadius(3)));

        protected override void OnClick()
        {
            IsChecked = !IsChecked;
        }
        static AnToggleButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(AnToggleButton), new FrameworkPropertyMetadata(typeof(AnToggleButton)));
        }
    }
}
